<%
/**
 *  edit 系统菜单编辑
 * 
 * @author   李荣华
 * @version v1.0
 * @date     2017-11-12
 * @since   JSP 2.3.1
 */
%>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="at" uri="http://www.jketing.com/at"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>菜单编辑</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta content="no-cache" http-equiv="Pragma"/>
	<meta content="no-cache" http-equiv="Cache-Control"/>
	<meta content="0" http-equiv="Expires"/>
	<meta name="GENERATOR" content="MSHTML 8.00.6001.18854"/>
	<link rel="stylesheet" id="edit" type="text/css" href="<at:url css="edit.css"/>" />
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/scripts/Common/validation-engine-2.2/css/validationEngine.jquery.css"/>
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/scripts/Common/validation-engine-2.2/css/template.css"/>			
	<link rel="stylesheet" type="text/css" id="banner" href="<at:url css="banner_button.css"/>" />
	<script type="text/javascript" src="${pageContext.request.contextPath}/scripts/jquery.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/scripts/common.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/scripts/Common/validation-engine-2.2/languages/jquery.validationEngine-cn.js" charset="utf-8"></script>
       <script type="text/javascript" src="${pageContext.request.contextPath}/scripts/Common/validation-engine-2.2/jquery.validationEngine.js" charset="utf-8"></script>
	<script type="text/javascript" src="<at:url js="edit.js"/>"></script>
	<script type="text/javascript" src="<at:url js="banner_button.js"/>"></script>
	<script type="text/javascript">
		/**
		 * 重置操作
		 */
		function reset() {
			$("#webForm").reset();
		}	
		
		/**
		 * 返回列表
		 */
		function ret(){				
			if(window.confirm('数据没保存，你确定要返回列表吗？')){
				window.history.back(-1);//因要删除进入更新编辑页时保存在session中的查询数据，故不能使用js退回
				
			}
		}
	
		/**
		 * 提交数据
		 */
		function submit() {
			/* if($("#webForm").validationEngine('validate')){
				$("#webForm").submit();
			} */
			$("#webForm").submit();
		}
		
		/**
		 * validation-engine 表单验证 
		 */
		jQuery(document).ready(function(){
               /*jQuery("#webForm").validationEngine({   
            validationEventTriggers:"keyup blur",  //触发的事件  validationEventTriggers:"keyup blur",   
            inlineValidation: true,//是否即时验证，false为提交表单时验证,默认true   
            success :  false,//为true时即使有不符合的也提交表单,false表示只有全部通过验证了才能提交表单,默认false   
            promptPosition: "topRight"//提示所在的位置，topLeft, topRight, bottomLeft,  centerRight, bottomRight   
            //failure : function() { alert("验证失败，请检查。");  }//验证失败时调用的函数   
            //success : function() { callSuccessFunction() },//验证通过时调用的函数   
            });*/
           });
		
	</script>
	<c:set value="${pageContext.request.contextPath}/function" var="url"></c:set>
	<c:if test="${entity.id != null }">
		<c:set value="${pageContext.request.contextPath}/function/${entity.id}" var="url"></c:set>
	</c:if>
</head>
<body style="margin: 0px;">		
	<form:form action="${url}" method="POST" modelAttribute="entity" class="form-style" id="webForm" name="webForm">
		<c:if test="${entity.id != null }">
			<form:hidden path="id"/>
			<input type="hidden" name="_method" value="PUT"/>
		</c:if>
		<input type="hidden" name="page" value="${page}"/>	
		<input type="hidden" name="order" value="${order}" />
		<!-- 按钮行 -->
		<div class="edit_top_f">
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td width="4" height="24" id="kj2z03"></td>
					<td class="biao3_xia">
						<table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td height="24" class="biao4_zhong">
									<div id="nav_01">
										<ul>
											<li><a href="#" onclick="ret();">返回</a></li>
											<li><a href="#" onclick="submit();">提交</a></li>
										</ul>
									</div>
								</td>
							</tr>
						</table>
					</td>
					<td width="4" height="24" id="kj2y03"></td>
				</tr>
			</table>
		</div>
		<div class="edit_main_f">
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td> 													
						<table width="100%" border="0" cellspacing="0" cellpadding="0" rules="groups">
							<tr>
								<td width="20%" height="100%" class="biantiao_you">
									<table width="100%" border="0" cellspacing="5" cellpadding="5">
										<tr>
											<td align="right" valign="middle" class="font_1">
												功能父级
											</td>																				
										</tr>
									</table>
								</td>
								<td width="30%" height="100%" class="biantiao_you">
									<table width="100%" border="0" cellspacing="5" cellpadding="5">
										<tr>																				
											<td align="left">
												<form:select path="parent.id" items="${funList}" 
													class="validate[required]" id="parentId"
													style="width:81%" itemLabel="name" itemValue="id"></form:select>
												<font color="red">*</font>
											</td>
										</tr>
									</table>
								</td>
								
								<td width="20%" height="100%" class="biantiao_you">
									<table width="100%" border="0" cellspacing="5"
										cellpadding="5">
										<tr>
											<td align="right" class="font_1">
												功能类型
											</td>
										</tr>
									</table>
								</td>
								<td width="30%" height="100%">
									<table width="100%" border="0" cellspacing="5"
										cellpadding="5">
										<tr>																				
											<td align="left">
												<select class="validate[required]" id="entityFunType" name="funType" style="width:81%">
													<c:if test="${nodeType==1}">
														<option value="2">菜单</option>
													</c:if>
													<c:if test="${nodeType==2}">
														<option value="3" >功能</option>
													</c:if>
													<c:if test="${entity.funType!=null}">
														<option value="${entity.funType}"><c:if test="${entity.funType==2}">菜单</c:if><c:if test="${entity.funType==3}">功能</c:if></option>
													</c:if>
												</select>
												<font color="red">*</font>
											</td>
										</tr>
									</table>
								</td>
							</tr>
							
							<!-- 行分割线 -->
							<tr>
								<td height="1" class="biaotiao_xia" colspan="4"></td>																	
							</tr>											
							
							<tr>
								<td width="20%" height="100%" class="biantiao_you">
									<table width="100%" border="0" cellspacing="5" cellpadding="5">
										<tr>
											<td width="25%" align="right" valign="middle" class="font_1">
												功能名称
											</td>																				
										</tr>
									</table>
								</td>
								<td width="30%" height="100%" class="biantiao_you">
									<table width="100%" border="0" cellspacing="5" cellpadding="5">
										<tr>																				
											<td width="75%" align="left">
												<form:input id="name" path="name" class="validate[required]" style="width: 80%" />
												<font color="red">*</font>
											</td>
										</tr>
									</table>
								</td>
								<td width="20%" height="100%" class="biantiao_you">
									<table width="100%" border="0" cellspacing="5" cellpadding="5">
										<tr>
											<td width="25%" align="right" class="font_1">功能地址</td>																				
										</tr>
									</table>																		
								</td>
								<td width="30%" height="100%">
									<table width="100%" border="0" cellspacing="5" cellpadding="5">
										<tr>																				
											<td width="75%" align="left">
												<form:input id="url" path="url"  style="width: 80%" />
											</td>
										</tr>
									</table>
								</td>
							</tr> 
							<!-- 行分割线 -->
							<tr>
								<td height="1" class="biaotiao_xia" colspan="4"></td>																	
							</tr>											
							
							<tr>
								<td width="20%" height="100%" class="biantiao_you">
									<table width="100%" border="0" cellspacing="5" cellpadding="5">
										<tr>
											<td width="25%" align="right" valign="middle" class="font_1">
												启用状态
											</td>																				
										</tr>
									</table>
								</td>
								<td width="30%" height="100%" class="biantiao_you">
									<table width="100%" border="0" cellspacing="5" cellpadding="5">
										<tr>																				
											<td align="left">																				
												<select name="useable" style="width:81%">
													<option value="true" ${entity.useable=='true'?'selected':''}>使用</option>
													<option value="false" ${entity.useable=='false'?'selected':''}>保留</option>
												</select>
											</td>
										</tr>
									</table>
								</td>
								<td width="20%" height="100%" class="biantiao_you">
									<table width="100%" border="0" cellspacing="5" cellpadding="5">
										<tr>
											<td width="25%" align="right" class="font_1">
												排列顺序
											</td>																				
										</tr>
									</table>																		
								</td>
								<td width="30%" height="100%">
									<table width="100%" border="0" cellspacing="5" cellpadding="5">
										<tr>																				
											<td width="75%" align="left">
												<form:input id="orderNumber" path="orderNumber"  class="validate[custom[onlyNumberSp]]" style="width: 80%" />
											</td>
										</tr>
									</table>
								</td>
							</tr> 					
							<!-- 行分割线 -->
							<tr>
								<td height="1" class="biaotiao_xia" colspan="4"></td>																	
							</tr>																
							<tr>
								<td width="20%" height="100%" class="biantiao_you">
									<table width="100%" border="0" cellspacing="5" cellpadding="5">
										<tr>
											<td align="right" valign="middle" class="font_1">
												备注
											</td>																				
										</tr>
									</table>
								</td>
								<td width="30%" height="100%"  colspan="4">
									<table width="100%" border="0" cellspacing="5" cellpadding="5">
										<tr>
											<td align="left" valign="middle" class="font_1">
												<form:textarea path="remark" rows="4" cols="53" style="width:93%"/>
											</td>
										</tr> 
									</table>
								</td>																			
							</tr>
							<tr>
								<td height="1" class="biaotiao_xia" colspan="4"></td>																	
							</tr>																
						</table>															
					</td>
				</tr>
			</table>
		</div>
	</form:form>
</body>
</html>
